import { useRef } from 'react'

export function useGlobalState() {
  const state = useRef<Record<string, any>>({})

  const setState = (key: string, value: any) => {
    state.current[key] = value
  }

  return [state.current, setState] as const
}
